<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.hytc.entity.Product" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.hytc.entity.Cart" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: 凉夏
  Date: 2024/4/16
  Time: 8:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <title>Title</title>
</head>
<body>
<ul>

<%--<h1>家用电器</h1>--%>
<%--    <c:forEach items="${applicationScope.product}" var="pro">--%>
<%--        <c:if test="${pro.classify_id == 1}">--%>
<%--            <li><a href="catlist.jsp">${pro.commodity_name} </li>--%>
<%--            <li><img src="${pro.commodity_picture}"></li>--%>
<%--        </c:if>--%>
<%--    </c:forEach>--%>
<%--    <%--%>
<%--        // 获取ProductServlet实例，用来获取商品列表--%>
<%--        ProductServlet productServlet = (ProductServlet) request.getServletContext().getAttribute("productServlet");--%>
<%--        List<Product> products = productServlet.getProducts();--%>
<%--    %>--%>
    <form action="http://localhost:8080/shopping/shoppingServlet" method="get">
    <%-- 商品列表的HTML代码 --%>
    <table>
        <tr>
            <th>商品名称</th>
            <th>价格</th>
            <th>操作</th>
        </tr>
                    <%= request.getAttribute("products") %>
                    <input type="hidden" name="productId" >
                    <input type="submit" value="添加到购物车">
    </table>
    </form>
</ul>
</body>
</html>
